﻿using System;
using System.Data;

namespace Shopping.Entities
{
    /// -----------------------------------------------------------------------------
    ///<summary>
    /// The Info class for the UsersInfo
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// </history>
    /// -----------------------------------------------------------------------------
    public class UsersInfo
    {
        #region Private Members

        private string _userName = "";
        private string _password = "";
        private string _email = "";
        private string _address = "";
        private string _provice = "";
        private DateTime _lastestLogon;
        private string _district = "";
        private string _ward = "";
        private DateTime _createDate;
        private string _secretKey = "";
        private string _avatar = "";
        private DateTime _birthday;
        private byte _gender;
        private string _fullName = "";
        private byte _groupId;
        private bool _trackNews;
        private decimal _money;
        private byte _introCount;
        #endregion
        #region Constructors
        // initialization

        #endregion
        #region Public Properties
        /// <summary>
        /// Get and Set Property Data of File column UserName in Table Users 
        /// </summary>

        public string UserName
        {
            get { return _userName; }
            set { _userName = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Password in Table Users 
        /// </summary>

        public string Password
        {
            get { return _password; }
            set { _password = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Email in Table Users 
        /// </summary>
        public string Email
        {
            get { return _email; }
            set { _email = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Address in Table Users 
        /// </summary>

        public string Address
        {
            get { return _address; }
            set { _address = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Provice in Table Users 
        /// </summary>

        public string Provice
        {
            get { return _provice; }
            set { _provice = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column LastestLogon in Table Users 
        /// </summary>

        public DateTime LastestLogon
        {
            get { return _lastestLogon; }
            set { _lastestLogon = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column District in Table Users 
        /// </summary>

        public string District
        {
            get { return _district; }
            set { _district = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Ward in Table Users 
        /// </summary>

        public string Ward
        {
            get { return _ward; }
            set { _ward = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column CreateDate in Table Users 
        /// </summary>

        public DateTime CreateDate
        {
            get { return _createDate; }
            set { _createDate = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column SecretKey in Table Users 
        /// </summary>

        public string SecretKey
        {
            get { return _secretKey; }
            set { _secretKey = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Avatar in Table Users 
        /// </summary>

        public string Avatar
        {
            get { return _avatar; }
            set { _avatar = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Birthday in Table Users 
        /// </summary>

        public DateTime Birthday
        {
            get { return _birthday; }
            set { _birthday = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Gender in Table Users 
        /// </summary>

        public byte Gender
        {
            get { return _gender; }
            set { _gender = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column FullName in Table Users 
        /// </summary>

        public string FullName
        {
            get { return _fullName; }
            set { _fullName = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column GroupId in Table Users 
        /// </summary>

        public byte GroupId
        {
            get { return _groupId; }
            set { _groupId = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column TrackNews in Table Users 
        /// </summary>

        public bool TrackNews
        {
            get { return _trackNews; }
            set { _trackNews = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Money in Table Users 
        /// </summary>

        public decimal Money
        {
            get { return _money; }
            set { _money = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column IntroCount in Table Users 
        /// </summary>

        public byte IntroCount
        {
            get { return _introCount; }
            set { _introCount = value; }
        }

        #endregion

        #region IHydratable Implementation

        /// <summary>
        /// 
        /// </summary>        
        public void Fill(IDataReader oReader)
        {
            _userName = Convert.ToString(oReader["UserName"]);
            _password = Convert.ToString(oReader["Password"]);
            _email = Convert.ToString(oReader["Email"]);
            _address = Convert.ToString(oReader["Address"]);
            _provice = Convert.ToString(oReader["Provice"]);
            _lastestLogon = DateTime.Parse(oReader["LastestLogon"].ToString());
            _district = Convert.ToString(oReader["District"]);
            _ward = Convert.ToString(oReader["Ward"]);
            _createDate = DateTime.Parse(oReader["CreateDate"].ToString());
            _secretKey = Convert.ToString(oReader["SecretKey"]);
            _avatar = Convert.ToString(oReader["Avatar"]);
            _birthday = DateTime.Parse(oReader["Birthday"].ToString());
            _gender = byte.Parse(oReader["Gender"].ToString());
            _fullName = Convert.ToString(oReader["FullName"]);
            _groupId = byte.Parse(oReader["GroupId"].ToString());
            _trackNews = bool.Parse(oReader["TrackNews"].ToString());
            _money = decimal.Parse(oReader["Money"].ToString());
            _introCount = byte.Parse(oReader["IntroCount"].ToString());
        }
        #endregion
    }
}